var SERVERDATE,DATEMODEL,arrayNo="01,13,25,37,49 02,14,26,38 03,15,27,39 04,16,28,40 05,17,29,41 06,18,30,42 07,19,31,43 08,20,32,44 09,21,33,45 10,22,34,46 11,23,35,47 12,24,36,48".split(" "),arrNo=[{begindate:"2014-01-30",enddate:"2015-02-18",an:"\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20,\u732a,\u72d7,\u9e21,\u7334,\u7f8a"},{begindate:"2015-02-19",enddate:"2016-02-07",an:"\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20,\u732a,\u72d7,\u9e21,\u7334"},{begindate:"2016-02-08",enddate:"2017-01-27",
an:"\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20,\u732a,\u72d7,\u9e21"},{begindate:"2017-01-28",enddate:"2018-02-15",an:"\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20,\u732a,\u72d7"},{begindate:"2018-02-16",enddate:"2019-02-04",an:"\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20,\u732a"},{begindate:"2019-02-05",enddate:"2020-01-24",an:"\u732a,\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b,\u9f20"},{begindate:"2020-01-25",
enddate:"2021-02-11",an:"\u9f20,\u732a,\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e,\u725b"},{begindate:"2021-02-12",enddate:"2022-01-31",an:"\u725b,\u9f20,\u732a,\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154,\u864e"},{begindate:"2022-02-01",enddate:"2023-01-21",an:"\u864e,\u725b,\u9f20,\u732a,\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99,\u5154"},{begindate:"2023-01-22",enddate:"2024-02-09",an:"\u5154,\u864e,\u725b,\u9f20,\u732a,\u72d7,\u9e21,\u7334,\u7f8a,\u9a6c,\u86c7,\u9f99"}],
arrWxNo=[{begindate:"2015-02-19",enddate:"2016-02-07",j:"01,02,15,16,23,24,31,32,45,46",m:"05,06,13,14,27,28,35,36,43,44",s:"03,04,11,12,19,20,33,34,41,42,49",h:"07,08,21,22,29,30,37,38",t:"09,10,17,18,25,26,39,40,47,48"},{begindate:"2016-02-08",enddate:"2017-01-27",j:"02,03,16,17,24,25,32,33,46,47",m:"06,07,14,15,28,29,36,37,44,45",s:"04,05,12,13,20,21,34,35,42,43",h:"01,08,09,22,23,30,31,38,39",t:"10,11,18,19,26,27,40,41,48,49"},{begindate:"2017-01-28",enddate:"2018-02-15",j:"03,04,17,18,25,26,33,34,47,48",
m:"07,08,15,16,29,30,37,38,45,46",s:"05,06,13,14,21,22,35,36,43,44",h:"01,02,09,10,23,24,31,32,39,40",t:"11,12,19,20,27,28,41,42,49"},{begindate:"2018-02-16",enddate:"2019-02-04",j:"04,05,18,19,26,27,34,35,48,49",m:"01,08,09,16,17,30,31,38,39,46,47",s:"06,07,14,15,22,23,36,37,44,45",h:"02,03,10,11,24,25,32,33,40,41",t:"12,13,20,21,28,29,42,43"},{begindate:"2019-02-05",enddate:"2020-01-24",j:"05,06,19,20,27,28,35,36,49",m:"01,02,09,10,17,18,31,32,39,40,47,48",s:"07,08,15,16,23,24,37,38,45,46",h:"03,04,11,12,25,26,33,34,41,42",
t:"13,14,21,22,29,30,43,44"},{begindate:"2020-01-25",enddate:"2021-02-11",j:"06,07,20,21,28,29,36,37",m:"02,03,10,11,18,19,32,33,40,41,48,49",s:"08,09,16,17,24,25,38,39,46,47",h:"04,05,12,13,26,27,34,35,42,43",t:"01,14,15,22,23,30,31,44,45"},{begindate:"2021-02-12",enddate:"2022-01-31",j:"07,08,21,22,29,30,37,38",m:"03,04,11,12,19,20,33,34,41,42,49",s:"09,10,17,18,25,26,39,40,47,48",h:"05,06,13,14,27,28,35,36,43,44",t:"01,02,15,16,23,24,31,32,45,46"},{begindate:"2022-02-01",enddate:"2023-01-21",j:"01,08,09,22,23,30,31,38,39",
m:"04,05,12,13,20,21,34,35,42,43",s:"10,11,18,19,26,27,40,41,48,49",h:"06,07,14,15,28,29,36,37,44,45",t:"02,03,16,17,24,25,32,33,46,47"},{begindate:"2023-01-22",enddate:"2024-02-09",j:"01,02,09,10,23,24,31,32,39,40",m:"05,06,13,14,21,22,35,36,43,44",s:"11,12,19,20,27,28,41,42,49",h:"07,08,15,16,29,30,37,38,45,46",t:"03,04,17,18,25,26,33,34,47,48"}],arrRGB={r:"01,02,07,08,12,13,18,19,23,24,29,30,34,35,40,45,46",g:"05,06,11,16,17,21,22,27,28,32,33,38,39,43,44,49",b:"03,04,09,10,14,15,20,25,26,31,36,37,41,42,47,48"},
arrTail="10,20,30,40 01,11,21,31,41 02,12,22,32,42 03,13,23,33,43 04,14,24,34,44 05,15,25,35,45 06,16,26,36,46 07,17,27,37,47 08,18,28,38,48 09,19,29,39,49".split(" ");function getYearAnimal(a){for(var b="",c=0;c<arrNo.length;c++){var f=arrNo[c];if(a>=f.begindate&&a<=f.enddate){b=f.an;break}}return b}function getZodiacToNo(a,b){for(var c="",f=getYearAnimal(b).split(","),d=0;d<f.length;d++)if(f[d]==a){c=arrayNo[d];break}return c}
var hk6_an_num={1:"\u9f20",2:"\u725b",3:"\u864e",4:"\u5154",5:"\u9f99",6:"\u86c7",7:"\u9a6c",8:"\u7f8a",9:"\u7334",10:"\u9e21",11:"\u72d7",12:"\u732a"},hk6_color={red:[1,2,7,8,12,13,18,19,23,24,29,30,34,35,40,45,46],blue:[3,4,9,10,14,15,20,25,26,31,36,37,41,42,47,48],green:[5,6,11,16,17,21,22,27,28,32,33,38,39,43,44,49]};
$(function(){$("#quick_sec_table td").each(function(){var a=$(this);a.hover(function(){a.addClass("hover")},function(){a.removeClass("hover")})});$("#bntquick").click(function(){"\u5feb\u6377\u6295\u6ce8"==$(this).val()?($("#changlong").hide(),$("#quick_sec_table").show(),$(this).val("\u4e24\u9762\u957f\u9f99")):($("#changlong").show(),$("#quick_sec_table").hide(),$(this).val("\u5feb\u6377\u6295\u6ce8"))});SERVERDATE=(new Date).format("yyyy-MM-dd");intervalTimer();$("#quick_sec_table tr td").click(function(){var a=
PeriodPanel.period;if(a&&1==a.status){a=$(this).attr("data").split("-");"ctl"==a[0]?(sec_simple(a[1]),"clear"==a[1]?$("#quick_sec_table td").removeClass("on"):"all"==a[1]?$("#quick_sec_table td:not(.ctl)").addClass("on"):"fx"==a[1]&&$("#quick_sec_table td:not(.ctl)").toggleClass("on")):($(this).toggleClass("on"),$(this).hasClass("on")?oper_sel(a):(_REMOVE=!0,oper_sel(a),_REMOVE=!1,$("#quick_sec_table td.on").each(function(){oper_sel($(this).attr("data").split("-"))})));var a=$("#bet_panel th.selected").length,
b=$("#betcount").text(a);0==a?b.parent().hide():b.parent().show()}else parent.showMsg("\u540e\u53f0\u672a\u5f00\u76d8")})});
var oper_sel=function(a){"col"==a[0]?sec_col(a[1],a[2]):"sple"==a[0]?sec_simple(a[1]):"an"==a[0]&&sec_animal(a[1])},_REMOVE=!1,oper_class=function(a){a=$("."+HK6type+"_"+(10<=a?a:"0"+a));_REMOVE?a.removeClass("selected"):a.addClass("selected");if(a.hasClass("selected")){var b=$("label.quickAmount input").val();a.find("input").val(b)}else a.find("input").val("")},oper_class_clear=function(a){a=$("."+HK6type+"_"+(10<=a?a:"0"+a));a.removeClass("selected");a.find("input").val("")},sec_col=function(a,
b){var c=function(a){for(var c=0;c<a.length;c++){var e=a[c];""==b?oper_class(e):"dan"==b&&1==e%2?oper_class(e):"shuang"==b&&0==e%2?oper_class(e):"da"==b&&24<e&&49>e?oper_class(e):"xiao"==b&&24>=e&&oper_class(e)}};"red"==a?c(hk6_color.red):"blue"==a?c(hk6_color.blue):"green"==a&&c(hk6_color.green)},sec_simple=function(a){for(var b=1;49>=b;b++){var c=10<=b?(b-b%10)/10+b%10:b;"all"==a?oper_class(b):"clear"==a?oper_class_clear(b):"fx"==a?$("."+HK6type+"_"+(10<=b?b:"0"+b)).hasClass("selected")?oper_class_clear(b):
oper_class(b):"danM"==a&&1==b%2?oper_class(b):"shuangM"==a&&0==b%2?oper_class(b):"daM"==a&&24<b&&49>b?oper_class(b):"xiaoM"==a&&24>=b?oper_class(b):"xdan"==a&&1==b%2&&24>=b?oper_class(b):"xshuang"==a&&0==b%2&&24>=b?oper_class(b):"ddan"==a&&1==b%2&&24<b?oper_class(b):"dshuang"==a&&0==b%2&&24<b?oper_class(b):"hdan"==a&&1==c%2?oper_class(b):"hshuang"==a&&0==c%2?oper_class(b):"hda"==a&&6<c?oper_class(b):"hxiao"==a&&6>=c?oper_class(b):"tou0"==a&&10>b?oper_class(b):"tou1"==a&&20>b&&10<=b?oper_class(b):
"tou2"==a&&30>b&&20<=b?oper_class(b):"tou3"==a&&40>b&&30<=b?oper_class(b):"tou4"==a&&50>b&&40<=b?oper_class(b):"wei0"==a&&0==b%10?oper_class(b):"wei1"==a&&1==b%10?oper_class(b):"wei2"==a&&2==b%10?oper_class(b):"wei3"==a&&3==b%10?oper_class(b):"wei4"==a&&4==b%10?oper_class(b):"wei5"==a&&5==b%10?oper_class(b):"wei6"==a&&6==b%10?oper_class(b):"wei7"==a&&7==b%10?oper_class(b):"wei8"==a&&8==b%10?oper_class(b):"wei9"==a&&9==b%10&&oper_class(b)}},sec_animal=function(a){for(var b=getZodiacToNo(hk6_an_num[a],
SERVERDATE).split(","),c=0;c<b.length;c++)a=Number(b[c]),oper_class(a)};function get_animal_by_ball(a){a=Number(a)%12-1;-1==a&&(a=11);return getYearAnimal(SERVERDATE).split(",")[a]}var get_animal_by_ball_time=function(a,b){var c=Number(a)%12-1;-1==c&&(c=11);return getYearAnimal(b).split(",")[c]};function analyzeBall(a,b){for(var c="",f=a.split(","),d=0;d<f.length;d++){var e=f[d];1==b?49!=e&&(c+='<span class="b'+e+'">'+e+"</span>"):c+='<span class="b'+e+'">'+e+"</span>"}return c}
function getServerDate(a){a=new Date(a);try{return{Y:a.getYear()+1900,M:10>a.getMonth()+1?"0"+(a.getMonth()+1):a.getMonth()+1,d:a.getDate(),H:a.getHours(),m:a.getMinutes(),s:a.getSeconds()}}catch(b){}return null}var h,timeCount=10;function intervalTimer(){clearInterval(h);setZodiacBalls();0>=timeCount?(timeCount=10,setZodiacBalls()):timeCount--;h=setInterval(intervalTimer,1E4)}
function setZodiacBalls(){$("#bet_panel tr:not(.head)").each(function(){$(this).children("td").each(function(){if($(this).hasClass("balls")){SERVERDATE=(new Date(PeriodPanel.now())).format("yyyy-MM-dd");var a=$(this).attr("id").substr(2);if("1"==hk6GameType){var a=$(".wxball_"+a),b=a.attr("data"),b=getYearToWxNo(b,SERVERDATE),b=analyzeBall(b,0);a.html(b)}else if("0"==hk6GameType)a=$(".sxball_"+a),b=a.attr("data"),b=getZodiacToNo(b,SERVERDATE),b=analyzeBall(b,0),a.html(b);else if("2"==hk6GameType)a=
$(".hxball_"+a),b=a.attr("data"),b=getZodiacToNo(b,SERVERDATE),b=analyzeBall(b,1),a.html(b);else if("3"==hk6GameType||"4"==hk6GameType)a="3"==hk6GameType?$(".sbball_"+a):$(".wsball_"+a),b=a.attr("data"),b=getRGBorTailToNo(b,hk6GameType),b=analyzeBall(b,0),a.html(b)}})})}
function getYearToWxNo(a,b){for(var c="",f=0;f<arrWxNo.length;f++){var d=arrWxNo[f];if(b>=d.begindate&&b<=d.enddate){switch(a){case "\u91d1":c=d.j;break;case "\u6728":c=d.m;break;case "\u6c34":c=d.s;break;case "\u706b":c=d.h;break;case "\u571f":c=d.t}break}}return c}function getRGBorTailToNo(a,b){var c="";if("3"==b)switch(a){case "\u7ea2\u6ce2":c=arrRGB.r;break;case "\u84dd\u6ce2":c=arrRGB.b;break;case "\u7eff\u6ce2":c=arrRGB.g}else"4"==b&&(a=a.replace("\u5c3e",""),c=arrTail[a]);return c};
